declare type color = number;
namespace Color {
	//basic
	export const BLACK = 0x000000;
	export const GRAY = 0x808080;
	export const WHITE = 0xFFFFFF;
	export const RED = 0xFF0000;
	export const GREEN = 0x00FF00;
	export const BLUE = 0x0000FF;
	export const YELLOW = 0xFFFF00;
	export const CYAN = 0x00FFFF;
	export const MAGANTA = 0xFF00FF;
	//extends
	export const GOLD = 0xFFD700;
	export const ORANGE = 0xFF8800;
	export const OLIVE = 0x808000;
	export const PINK = 0xFFC0CB;
	export const PURPLE = 0x800080;
	export const SKY_BLUE = 0x87CEEB;
	export const CHOCOLATE = 0xD2691E;
	export const BROWN = 0xA52A2A;
	export const LIGHT_GRAY = 0xD3D3D3;
	export const DARK_GRAY = 0x696969;
	export const SILVER = 0xC0C0C0;
	export function random(): color {
		return Math.round(Color.WHITE * Math.random());
	}
	export const Default = {
		TEXT: Color.WHITE,
		TEXT_DISABLED: Color.GRAY,
		LINE: Color.GREEN,
		FILL: Color.GRAY,
		COLOR_MATRIX: [
			1, 0, 0, 0, 0,
			0, 1, 0, 0, 0,
			0, 0, 1, 0, 0,
			0, 0, 0, 1, 0
		],
		GRAY_MATRIX: [
			0.3, 0.3, 0.3, 0, 0,
			0.3, 0.3, 0.3, 0, 0,
			0.3, 0.3, 0.3, 0, 0,
			0, 0, 0, 1, 0],
		LIGHT_MATRIX: [
			1.3, 0, 0, 0, 0,
			0, 1.3, 0, 0, 0,
			0, 0, 1.3, 0, 0,
			0, 0, 0, 1.3, 0],
		DIM_MATRIX: [
			0.7, 0, 0, 0, 0,
			0, 0.7, 0, 0, 0,
			0, 0, 0.7, 0, 0,
			0, 0, 0, 0.7, 0],
	}
	export type RGB = { r: number, g: number, b: number, a?: number };
	export function toRGB(color: color): RGB {
		return { r: color >> 16, g: (color >> 8) % 256, b: color % 256, a: 1 }
	}
}